package com.serviceImpl;

import com.dao.LabelDao;
import com.domain.Discuss;
import com.domain.Label;
import com.server.LabelService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("labelService")
public class LabelServiceImpl implements LabelService {

    @Resource(name="labelDao")
    private LabelDao labelDao;

    @Override
    public Label selectLabelById(int id) {
        return labelDao.selectLabelById(id);
    }

    @Override
    public List<Label> findAllLabel() {
        return labelDao.findAllLabel();
    }

    @Override
    public int addLabel(Label label) {
        return labelDao.addLabel(label);
    }

    @Override
    public int selectLabelIdByName(String name) {
        return labelDao.selectLabelIdByName(name);
    }

    @Override
    public List<Label> selectLabelByLikeName(String name) {
        return labelDao.selectLabelByLikeName(name);
    }

    @Override
    public List<Discuss> selectDiscussByLikeLabelName(String name) {
        return labelDao.selectDiscussByLikeLabelName(name);
    }

    @Override
    public List<Label> selectLabelByDiscussId(Integer discuss_id) {
        return labelDao.selectLabelByDiscussId(discuss_id);
    }

    @Override
    public //通过资源id，查询所选标签：
    List<Label> selectLabelByResourceId(Integer resource_id){
        return labelDao.selectLabelByResourceId(resource_id);
    }

    @Override
    public int findLastLabelId() {
        return labelDao.findLastLabelId();
    }



}
